angular.module('starter.config', [])
.constant('DB_CONFIG', {
    name: 'altura_running.db',
    tables: [
		{
            name: 'types',
            columns: [
                {name: 'id', type: 'integer primary key'},
                {name: 'name', type: 'text'},
                {name: 'table_name', type: 'text'},
                {name: 'image', type: 'text'},
                {name: 'aux1', type: 'text'},
                {name: 'aux2', type: 'text'}
            ]
        },
		{
			name: 'exercises',
			columns: [
				{name: 'id', type: 'integer primary key'},
				{name: 'name', type: 'text'},
				{name: 'ex_date_time', type: 'integer'},
				{name: 'plan_id', type: 'integer'},
				{name: 'type_id', type: 'integer'},
				{name: 'person_id', type: 'integer'},
				{name: 'duration', type: 'integer'},
				{name: 'distance', type: 'real'},
				{name: 'speed', type: 'real'},
				{name: 'max_speed', type: 'real'},
				{name: 'calories', type: 'integer'},
				{name: 'avg_hr', type: 'integer'}, 
				{name: 'max_hr', type: 'integer'},
				{name: 'pace', type: 'integer'},
				{name: 'img_route', type: 'text'},
				{name: 'last_change', type: 'integer'},
				{name: 'score', type: 'integer'},
				{name: 'plan_percent', type: 'real'},
				{name: 'cadence', type: 'integer'},
				{name: 'description', type: 'text'},
				{name: 'mode_id', type: 'integer'},
				{name: 'elevation_gain', type: 'real'},
				{name: 'is_pace', type: 'boolean'},
				{name: 'is_indoor', type: 'boolean'},
				{name: 'exported', type: 'boolean'}
			]		
		},
		
		{
			name: 'persons',
			columns: [
				{name: 'id', type: 'integer primary key'},
				{name: 'first_name', type: 'text'},
				{name: 'last_name', type: 'text'},
				{name: 'user_name', type: 'text'},
				{name: 'user_pass', type: 'text'},
				{name: 'email', type: 'text'},
				{name: 'gender', type: 'text'},
				{name: 'born_date', type: 'integer'},
				{name: 'age', type: 'integer'},
				{name: 'time_zone', type: 'integer'},
				{name: 'locale', type: 'text'},
				{name: 'city', type: 'text'},
				{name: 'state', type: 'text'},
				{name: 'country', type: 'text'},
				{name: 'facebook_id', type: 'text'},
				{name: 'facebook_token', type: 'text'},
				{name: 'strava_id', type: 'text'},
				{name: 'strava_token', type: 'text'},
				{name: 'weight', type: 'real'},
				{name: 'height', type: 'real'}
			]
		},
		
		{ 
			name: 'statistics',
			columns: [
				{name:	'id', type: 'integer primary key'},
				{name: 'exerc_id', type: 'integer'},
				{name: 'km', type: 'real'},
				{name: 'total_time', type: 'integer'},
				{name: 'd_time', type: 'integer'},
				{name: 'hrm', type: 'integer'},
				{name: 'speed', type: 'real'},
				{name: 'max_speed', type: 'real'},
				{name: 'ascent', type: 'real'},
				{name: 'descent', type: 'real'},
				{name: 'elevation_gain', type: 'real'},
				{name: 'cadence', type: 'integer'},
				{name: 'max_cadence', type: 'integer'}
			]
		},
		
		{
			name: 'data_exerc',
			columns: [
				{name: 'id', type: 'integer primary key'},
				{name: 'exerc_id', type: 'integer'},
				{name: 'd_time', type: 'integer'},
				{name: 'lat', type: 'real'},
				{name: 'lon', type: 'real'},
				{name: 'hrm', type: 'integer'},
				{name: 'alt', type: 'real'},
				{name: 'heading', type: 'text'},
				{name: 'speed', type: 'real'},
				{name: 'accuracy', type: 'real'}
			]
		}		
    ]
});